/* Write your script */
(function ($) {
    'use strict';

    $(function () {
        try {
            // 关闭自动完成
            $('input:text').attr('autocomplete', 'off');

            // 适应高度
            $('.admin-main .admin-content').css('min-height', $('.admin-main').height() + 'px');

            // 替换模板标签
            $('script[type="text/html"]').each(function () {
                var text = $(this).text();
                $(this).text(text.replace(/\{\{/g, '<%').replace(/\}\}/g, '%>'));
            });


            var $fullText = $('.admin-fullText');

            $('#admin-fullscreen').on('click', function () {
                $.AMUI.fullscreen.toggle();
            });

            $(document).on($.AMUI.fullscreen.raw.fullscreenchange, function () {
                $fullText.text($.AMUI.fullscreen.isFullscreen ? '退出全屏' : '开启全屏');
            });
        } catch (e) {
            // ignore
        }
    });

})(jQuery);
